package com.shop.pojo;

import com.baomidou.mybatisplus.annotation.*;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.ToString;

/**
 * 用户地址表 
 * 
 * @author yukangkang
 * @email sunlightcs@gmail.com
 * @date 2020-10-30 13:16:29
 */
@Data
@ToString
@TableName("user_address")
public class UserAddress implements Serializable {
	private static final long serialVersionUID = 1L;

		/**
		 * 地址主键id
		 */
		@TableId(value = ID)
		private String id;
		/**
		 * 关联用户id
		 */
		@TableField(USER_ID)
		private String userId;
		/**
		 * 收件人姓名
		 */
		@TableField(RECEIVER)
		private String receiver;
		/**
		 * 收件人手机号
		 */
		@TableField(MOBILE)
		private String mobile;
		/**
		 * 省份
		 */
		@TableField(PROVINCE)
		private String province;
		/**
		 * 城市
		 */
		@TableField(CITY)
		private String city;
		/**
		 * 区县
		 */
		@TableField(DISTRICT)
		private String district;
		/**
		 * 详细地址
		 */
		@TableField(DETAIL)
		private String detail;
		/**
		 * 扩展字段
		 */
		@TableField(EXTAND)
		private String extand;
		/**
		 * 是否默认地址
		 */
		@TableField(IS_DEFAULT)
		private Integer isDefault;
		/**
		 * 创建时间
		 */
		@TableField(value = CREATED_TIME,fill = FieldFill.INSERT)
		private Date createdTime;
		/**
		 * 更新时间
		 */
		@TableField(value = UPDATED_TIME,fill = FieldFill.INSERT_UPDATE)
		private Date updatedTime;




	public final static String ID =  "`id`";
	public final static String USER_ID =  "`user_id`";
	public final static String RECEIVER =  "`receiver`";
	public final static String MOBILE =  "`mobile`";
	public final static String PROVINCE =  "`province`";
	public final static String CITY =  "`city`";
	public final static String DISTRICT =  "`district`";
	public final static String DETAIL =  "`detail`";
	public final static String EXTAND =  "`extand`";
	public final static String IS_DEFAULT =  "`is_default`";
	public final static String CREATED_TIME =  "`created_time`";
	public final static String UPDATED_TIME =  "`updated_time`";


	public final static String ID_COMMENT =  "地址主键id";
	public final static String USER_ID_COMMENT =  "关联用户id";
	public final static String RECEIVER_COMMENT =  "收件人姓名";
	public final static String MOBILE_COMMENT =  "收件人手机号";
	public final static String PROVINCE_COMMENT =  "省份";
	public final static String CITY_COMMENT =  "城市";
	public final static String DISTRICT_COMMENT =  "区县";
	public final static String DETAIL_COMMENT =  "详细地址";
	public final static String EXTAND_COMMENT =  "扩展字段";
	public final static String IS_DEFAULT_COMMENT =  "是否默认地址";
	public final static String CREATED_TIME_COMMENT =  "创建时间";
	public final static String UPDATED_TIME_COMMENT =  "更新时间";


	public static UserAddress of(Object obj) {
		UserAddress e = new UserAddress();
		BeanUtils.copyProperties(obj, e);
		return e;
	}

	public static QueryWrapper<UserAddress> queryWrapper(Object obj) {
		return new QueryWrapper<>(of(obj));
	}



}
